package com.zhanghe.wzq.handler;

import com.zhanghe.protocol.v1.Command;
import com.zhanghe.protocol.v1.CommandType;
import com.zhanghe.protocol.v1.Packet;
import com.zhanghe.wzq.command.request.LoginRequest;
import com.zhanghe.wzq.handler.request.LoginRequestHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * CommandHandler
 *
 * @author Clevo
 * @date 2018/12/23
 */
@Slf4j
public class CommandHandler extends SimpleChannelInboundHandler<Packet> {
    @Override
    protected void channelRead0(ChannelHandlerContext channelHandlerContext, Packet packet) throws Exception {
        Byte command = packet.getCommand();
        log.debug("处理命令");
//        if(Command.getCommandClass(command).isInstance(LoginRequest.class)){
//            LoginRequestHandler handler = new LoginRequestHandler();
//        }
    }
}
